<?php 
						
	$company_details= $userObj->fetch_one("SELECT * FROM user_shops WHERE url='{$_GET['company']}'");
	if($company_details['active']==1){
	    $active_checked="checked='checked'";
	}else{
        $active_checked="";
	}
	$langs = $userObj->fetch_result("SELECT name,id FROM languages ");
			echo "<pre>";
			print_r($langs);
			echo "</pre>";
?>
									

                            <div id="user-profile-3" class="user-profile ">
									
										
										<!-- <div class="well well-small">
											<button type="button" class="close" data-dismiss="alert">&times;</button>
											&nbsp;
											<div class="inline middle blue bigger-110"> Your profile is 70% complete </div>

											&nbsp; &nbsp; &nbsp;
											<div style="width:200px;" data-percent="70%" class="inline middle no-margin progress progress-success progress-striped active">
												<div class="bar" style="width:70%"></div>
											</div>
										</div><!/well--> 

										<div class="space"></div>

										<form class="form-horizontal" id='profile_form' />
											<div class="tabbable">
												<ul class="nav nav-tabs padding-16">
													<li class="active">
														<a data-toggle="tab" href="#edit-basic">
															<i class="green icon-edit bigger-125"></i>
															<?php echo translate_word_shop("Basic_info"); ?>
														</a>
													</li>

													<!-- <li>
														<a data-toggle="tab" href="#edit-settings">
															<i class="purple icon-cog bigger-125"></i>
															Settings
														</a>
													</li> -->

													<li>
														<a data-toggle="tab" href="#description">
															<i class="green icon-edit bigger-125"></i>
															<?php echo translate_word_shop("Description"); ?>
														</a>
													</li>
													<li>
														<a data-toggle="tab" href="#logo_company">
															<i class="green icon-camera-retro bigger-125"></i>
															<?php echo translate_word_shop("Logo"); ?>
														</a>
													</li>
												</ul>

												<div class="tab-content profile-edit-tab-content">
													<div id="edit-basic" class="tab-pane in active">
														
														<h4 class="header blue bolder smaller"><?php echo translate_word_shop("Contact"); ?></h4>

														<div class="form-group clearfix">
															<label class="control-label col-md-4" for="form-field-email"><?php echo translate_word_shop("Company"); ?></label>

															<div class="controls col-md-6">
																<span >
																	<input type="text" id="form-field-email" class='form-control' name='name' value="<?php echo $company_details['name'] ?>" />
																
																</span>
															</div>
														</div>
														<div class="form-group clearfix">
															<label class="control-label col-md-4" for="form-field-email"><?php echo translate_word_shop("Buisness_type"); ?></label>
                                                            <?php 
                                                                $types = array('1'=>translate_word_shop("Producator"),
                                                                               '2'=>translate_word_shop("Distribuitor"),
                                                                               '3'=>translate_word_shop("Furnizor"));
                                                            ?>
															<div class="controls col-md-6">
																<select name = 'business_type' class='form-control'>
																   <?php 
																        foreach($types as $key=>$value){												           
                                                                            echo "<option value='{$key}' ";
                                                                            if($key == $company_details['business_type']){

                                                                                echo " selected='selected'  ";

                                                                            }
                                                                            echo ">{$value}</option>";                                                                     
																        }
																    ?> 
																   
																</select>
															</div>
														</div>										

														<div class="form-group clearfix">
															<label class="control-label col-md-4" for="state"><?php echo translate_word_shop("County"); ?></label>

															<div class="controls col-md-6">
																<span >
																	<select id="state" name="state" class="select2 form-control" onchange='make_cities(this.value)' data-placeholder="Click to Choose...">
																		
																		<?php 

																		   // $row = fetch_result("SELECT county_id, city_id FROM user WHERE session_user ='{$_SESSION['session_user']}'");

																			$row = $userObj->fetch_table('counties');
																			foreach ($row as $key => $value) { ?>
 																				<option value="<?php echo $value['id']; ?>" 
 																				<?php
 																				   if($value['id']==$company_details['county_id']){
 																				       echo "selected='selected'";
 																				   }
 																				 
 																				   ?>
 																				/><?php echo $value['name']; ?>	
																		<?php 
																			}
																		?>																						
																		
																	</select>
																</span>
															</div>
														</div>

														


														<div class="form-group clearfix">
															<label class="control-label col-md-4" for="city"><?php echo translate_word_shop("City"); ?></label>

															<div class="controls col-md-6">
																<span >
																	<select id="city" name="city" class="select2 cities_wrapper form-control" data-placeholder="Click to Choose...">
																    <?php 
																		$row = $userObj->fetch_result("SELECT * FROM cities WHERE county_id='{$company_details['county_id']}'");
																		foreach ($row as $key => $value) { 
																		    echo "<option value='{$value['id']}'";
																		    if($value['id']==$company_details['city_id']){
																		        echo " selected='selected' ";
																		    }
																		    echo ">{$value['name']}</option>";
																		}	
																	?>			
																	</select>
																</span>
															</div>
														</div>

														<div class="form-group clearfix">
															<label class="control-label col-md-4" for="form-field-comment"><?php echo translate_word_shop("Active"); ?></label>
															
															<div class="controls col-md-6">
																<input type='checkbox' name='active' class='form-control' value='1' <?php echo $active_checked; ?> >
																<span class='lbl'></span>
															</div>
														</div>														
													</div>


													<div id="description" class="tab-pane">
														
														<div class="tabbable">
															<ul class="nav nav-tabs padding-16">
																<?php 

																	foreach(langs as $key=>$value){
																		echo '<li ';
																		if($value['id']==$user['language_id']){
																			echo ' class="active" ';
																		}
																		echo '>
																				<a data-toggle="tab" href="#'.$value['name'].'">																					
																					'.$value['name'].'
																				</a>
																			</li>';
																	}

																?>
																
															</ul>
															<div class="tab-content profile-edit-tab-content">
																<?php 
																	foreach(langs as $key=>$value){
																		echo '<div id="'.$value['name'].'" class="tab-pane ">
																	
																			  </div>';
																	}
																?>
																
															</div>
														</div>

														<div class="col-md-10"></div>                                                        
                                                            
                                                            <div id="company_description" class="wysiwyg-editor header-color-blue" contenteditable="true">
                                                                <?php echo $company_details['company_description'] ?>
                                                            </div>                                                      
                                                        
													</div>
													<div id="logo_company" class="tab-pane">
														<div class="col-md-10"></div>  

													</div>
												</div>
											</div>
											<input type='hidden' id='company_url' value='<?php echo $company_details['url']; ?>'>

											<div class="form-actions">
												<button class="btn btn-info" type="button" onclick='save_company();'>
													<i class="icon-ok bigger-110"></i>
													<?php echo translate_word_shop("Salveaza"); ?>
												</button>	
												<a href='<?php echo scripts_url()."profil/companies.html" ?>' class="btn btn-info" >
													<i class="icon-ok bigger-110"></i>
													<?php echo translate_word_shop("Inapoi la companii"); ?>
												</a>												
											</div>
										</form>
									
								</div><!--/user-profile-->

